'use client';
import Search from "antd/es/input/Search";
import style from "./index.module.scss";
interface GlobalSearchProps {
    placeholder: string
    icon?:any
    className:string
    handleSearch:(value:string)=>void
}
export default function GlobalSearch(props: GlobalSearchProps) {
  const {placeholder,icon,className,handleSearch} = props;

  const onSearch = (value:string) => {
    console.log(value);
    handleSearch(value)
  }
  return (
    <div>
      <Search
        addonBefore={icon}
        placeholder={placeholder}
        allowClear
        onSearch={onSearch}
        className={className}
      />
    </div>
  );
}
